import { createApp } from 'vue'
import { createPinia } from 'pinia'
//全局注册lodash
import {throttle} from 'lodash'
//导入暗黑模式
import 'element-plus/theme-chalk/dark/css-vars.css'
//导入element-plus组件
import {
    ElSlider,
    ElPopconfirm,
    ElCarouselItem,
    ElCarousel,
    ElButton,
    ElBreadcrumbItem,
    ElBreadcrumb,
    ElTabPane,
    ElTabs,
    ElInfiniteScroll,
    ElInputNumber,
    ElCheckbox,
    ElEmpty,
    ElDialog,
    ElPagination,
    ElSkeleton,
    ElSkeletonItem,
    ElInput,
    ElForm,
    ElFormItem,
    ElUpload,
    ElImage,
    ElBadge,
    ElBacktop,
    ElDrawer,
    ElSwitch,
    ElSelect,
    ElOption,
    ElNotification,
    ElDropdown,
    ElDropdownItem,
    ElDropdownMenu,
} from 'element-plus'
import 'element-plus/dist/index.css'
//app
import App from './App.vue'
import router from './router'
//引入全局组件
import {componentList} from '@/components/index'
//导入字体图标
import '@fortawesome/fontawesome-free/css/all.css';
//导入懒加载组件并注册
import {lazyLoad} from '@/directives/index'
//导入持久化存储
import piniaPluginPersistedstate from 'pinia-plugin-persistedstate'
//初始化样式文件
import '@/styles/common.scss'
//导入i18n文件
import i18n from './uils/i18n'
const app = createApp(App)
//使用持久化存储插件
const pinia = createPinia()
pinia.use(piniaPluginPersistedstate)
//注册i18ns
app.use(i18n)
//注册全局组件
app.use(componentList)
//初始化云函数
app.use(pinia)
app.use(router)
//使用懒加载组件
app.use(lazyLoad)
//按需引入element-plus组件
app.use(ElPopconfirm)
app.use(ElCarouselItem)
app.use(ElCarousel)
app.use(ElButton)
app.use(ElBreadcrumbItem)
app.use(ElBreadcrumb)
app.use(ElTabPane)
app.use(ElTabs)
app.use(ElInfiniteScroll)
app.use(ElInputNumber)
app.use(ElCheckbox)
app.use(ElEmpty)
app.use(ElDialog)
app.use(ElPagination)
app.use(ElSkeleton)
app.use(ElSkeletonItem)
app.use(ElInput)
app.use(ElForm)
app.use(ElFormItem)
app.use(ElUpload)
app.use(ElImage)
app.use(ElBadge)
app.use(ElBacktop)
app.use(ElDrawer)
app.use(ElSwitch)
app.use(ElSelect)
app.use(ElOption)
app.use(ElNotification)
app.use(ElDropdown)
app.use(ElDropdownItem)
app.use(ElDropdownMenu)
app.use(ElSlider)
//注册全局样式文件
app.mount('#app')
